package com.imooc.aop.security;

/**
 * @ClassName CurrentUserHolder
 * @Description TODO
 * @Author Wxg
 * @Date 2018/11/14 13:01
 * @Version 1.0
 */
public class CurrentUserHolder {
    private static final ThreadLocal<String> holder = new ThreadLocal<>();

    public static String get() {
        return holder.get() == null ? "unknown" : holder.get();
    }

    public static void set(String user) {
        holder.set(user);
    }
}
